//获取应用实例
const app = getApp()

Page({
  data: {
    navData: [
      {
        name: "首页",  //文本
        current: 0,    //是否是当前页，0不是  1是
        style: 0,     //样式
        icourl: '/images/icon/ic_shouye.png', //不同图标
        fn: 'gotoIndex'   //对应处理函数
      }, {
        name: "分类",
        current: 1,
        style: 0,
        icourl: '/images/icon/ic_fenlei_2.png',
        fn: 'gotoOldGoods'
      }, {
        name: "AI量体",
        current: 0,
        style: 1,
        icourl: '/images/icon/ic_fenlei.png',
        fn: 'gotoPublish'
      }, {
        name: "专题",
        current: 0,
        style: 0,
        icourl: '/images/icon/ic_zhuanti.png',
        fn: 'gotoRecruit'
      }, {
        name: "我的",
        current: 0,
        style: 0,
        icourl: '/images/icon/ic_wode.png',
        fn: 'gotoMine'
      },
    ],
    winWidth: 0,  
    winHeight: 0,  
    scrollTop : 0,
    // tab切换  
    currentTab: 0, 
    productionTab: 0,
    status: 0,
  },
  changeStatus(e) {
    let that = this;
    let status = e.currentTarget.id;
    that.setData({
      status: status
    })
  },
  gotoIndex:function(){
    wx.redirectTo({
      url: '/pages/index/index',
    });
  },
  gotoPublish:function(){
    wx.redirectTo({
      url: '/pages/publish/publish',
    });
  },
  gotoRecruit:function(){
    wx.redirectTo({
      url: '/pages/recruit/recruit',
    });
  },
  gotoMine:function(){
    wx.redirectTo({
      url: '/pages/mine/mine',
    });
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    /** 
     * 获取系统信息 
     */  
    wx.getSystemInfo( {    
      success: function( res ) {  
        that.setData( {  
          winWidth: res.windowWidth,  
          winHeight: res.windowHeight  
        });  
      }  
  
    });  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
   
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  },
  imageLoad: function () {
    //bindload 图片加载的时候自动设定宽度  
    this.setData({
      imageWidth: wx.getSystemInfoSync().windowWidth
    })
  },
  // 上拉加载更多
  bindDownLoad:function(){   
    var that = this;
  }, 
  
})
